% title = 'New Paste'
% include(top)

<div class="pure-g">
	<div class="pure-u-1 center">
		<h1 class="center">New Paste</h1>
	</div>
	<div class="pure-u-1 pure-u-md-1-4"></div>
	<div class="pure-u-1 pure-u-md-1-2">
% if isFile:
		<p class="center boxed"><a href="/upload">Paste some text instead?</a></p>
% else: 
		<p class="center boxed"><a href="/upload?file=1">Paste a file instead?</a></p>
% end  # (if)
		<form action="/upload" enctype="multipart/form-data" method="post" class="pure-form pure-form-aligned upload">
			<fieldset class="pure-group">
% if username and username != 'anonymous':  # if logged in
				<input name="username" type="hidden" value="{{username}}">
				<p>Username: <b>{{username}}</b></p>
% else: # if anon
				<input name="username" type="hidden" value="anonymous">
				<p>Anonymous Upload - <a href="/login?redirect=/upload">Log in?</a></p>
% end  # (if)
				<input type="text" name="title" placeholder="Title">
				<label for="expires"><p>Expires:</p></label>
				<select required name="expires">
					<option value="0">never</option>
					<option value="+60">in a minute</option>
					<option value="+600">in 10 minutes</option>
					<option value="+3600">in an hour</option>
					<option value="+43200">in 12 hours</option>
					<option value="+86400">in a day</option>
					<option value="+604800">in a week</option>
					<option value="+2592000">in a month</option>
				</select>
			</fieldset>
% if isFile:
			<fieldset class="pure-group">
				<input type="file" name="upload" required >
			</fieldset>
% else:
			<fieldset class="pure-group">
				<p>Language Formatting:</p>
				<select required name="mimetype">
					<option value="auto">[Detect for me]</option>
					<option value="text/x-sh">Shell (BASH, CSH, etc.)</option>
					<option value="text/x-csrc">C</option>
					<option value="text/x-c++src">C++</option>
					<option value="text/x-csharp">C#</option>
					<option value="text/css">CSS</option>
					<option value="text/html">HTML</option>
					<option value="application/php">PHP</option>
					<option value="text/plain">Plain</option>
					<option value="text/x-ruby">Ruby</option>
					<option value="text/x-java">Java</option>
					<option value="text/javascript">Javascript</option>
					<option value="application/json">JSON</option>
					<option value="text/x-python">Python</option>
					<option value="text/xml">XML</option>
				</select>
				<textarea required name="text" type="text" rows="8" placeholder="Place text here!" autofocus></textarea>
			</fieldset>
% end  # (if)
			<fieldset class="pure-group">
				<button class="pure-button pure-input-1 pure-button-primary" type="submit">Paste</button>
			</fieldset>
		</form>
	</div>
	<div class="pure-u-1 pure-u-md-1-4"></div>
</div>

% include(bottom)
